package com.kaifamiao.base.Demo210815;

/**
 * @author lucien-ma
 * @date 2021/9/15
 * @apiNote
 */
public class Demo04 {
    public static void main(String[] a){
        Class1 obj1 = new Class1();
        Class2 obj2 = new Class2("hello", "world");
        obj1.x = 10;
        obj2.show();
        Class2 obj3 = new Class2();
        obj3.show("hello,world");
        obj1.setY(false);
        obj3.x = obj2;
        Class1 obj4 = new Class1();
        obj1.setY(obj4.show());
        Class1 obj6 = new Class1();
        Class1 obj5 = new Class1();
        obj5.show(obj6.x);
        obj2.obj8.x = 10;
        Class2 obj9 = new Class2();
        obj9.obj10.show(obj1.obj2.dispaly());
        obj9.obj10.show(obj1.obj2.dispaly(obj3.x, 100, "hello,world!"));
        System.out.println("运行通过");
    }
}

class Class1{
    public int x;
    private boolean y;
    public Class4 obj2 = new Class4();


    public Class1(){}

    public void setY(boolean y){
        this.y = y;
    }

    public boolean show(){
        return false;
    }

    public void show(int x){}

}

class Class2{
    private String param1;
    private String param2;
    public Class2 x;
    public Class1 obj8 = new Class1();
    public Class3 obj10 = new Class3() ;

    public Class2(){}

    public Class2(String param1, String param2){
        this.param1 = param1;
        this.param2 = param2;
    }

    public void show(){}

    public void show(String param1){}

}

class Class3{
    public void show(Object... objects){}
}

class Class4{
    public Object dispaly() {
        return "dispaly()";
    }

    public Object dispaly(Class2 x, int i, String s) {
        return "dispaly(Class2 x, int i, String s)";
    }
}
